#ifndef STRINGMODEL_H
#define STRINGMODEL_H

#include <QObject>
#include <QStringList>
#include <QAbstractListModel>
#include <QByteArray>

class StringModel : public QAbstractListModel
{
    Q_OBJECT
public:
    explicit StringModel(QObject *parent = 0);

    Qt::ItemFlags flags(const QModelIndex &index) const;
    QVariant data(const QModelIndex &index, int role) const;
    bool setData(const QModelIndex &index, const QVariant &value, int role);
    int rowCount(const QModelIndex &parent) const;
    QHash<int, QByteArray> roleNames() const;
    Q_INVOKABLE void addItem(int row, const QString& name,
                 const QString &city,
                 const QString &score);
private:
    enum ROLE{
        NAME_ROLE = 0,
        CITY_ROLE,
        SCORE_ROLE,
        ROLE_MAX
    };

    QStringList m_string_lists[ROLE_MAX];
};

#endif // STRINGMODEL_H
